﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShopSpace.Core.Query;

namespace ShopSpace.Core.Specification
{
	public class PersonPortalIdSpecification : CompositeSpecification<Person>
	{
		public int PortalId
		{
			get;
			set;
		}

		public PersonPortalIdSpecification(int portalId)
		{
			this.PortalId = portalId;
		}

		public override bool IsSatisfiedBy(Person candidate)
		{
			return candidate.PortalId.Equals(this.PortalId);
		}

		public override QueryBuilder<Person> AsQueryBuilder()
		{
			return Where.Person.PortalId.Eq(this.PortalId);
		}
	}
}
